﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeGenerator.CodeGenBL;
using CodeGenerator.Models;

namespace CodeGenerator.Models
{
    public class RelationshipModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int SourceMulticity { get; set; }
        public bool SourceNavigable { get; set; }
        public int DestMulticity { get; set; }
        public bool DestNavigable { get; set; }
        public int DestClass { get; set; }
        public RelationshipTypeModel DestType { get; set; }
        public RelationshipTypeModel SourceType { get; set; }
        public AttributeModel DestAttribute { get; set; }
        public AttributeModel SourceAttribute { get; set; }
        public int SourceClass { get; set; }

        public RelationshipModel() {}
        public RelationshipModel(RelationshipModelDto dot) 
        {
            Id = dot.Id;
            Name = dot.Name;
            SourceMulticity = dot.SourceMulticity;
            SourceNavigable = dot.SourceNavigable;
            DestMulticity = dot.DestMulticity;
            DestNavigable = dot.DestNavigable;
            DestClass = dot.DestClassId;
            SourceClass = dot.SourceClassId;
            DestType = new RelationshipTypeModel(dot.DestType);
            SourceType = new RelationshipTypeModel(dot.SourceType);
            DestAttribute = new AttributeModel(dot.DestAttribute);
            SourceAttribute = new AttributeModel(dot.SourceAttribute);

        }


    }
}
